﻿<navigation:Page x:Class="Slex.Lib.Demo.Views.Demos.InvokeMethod" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"      
           xmlns:slex="clr-namespace:Slex.Lib.Interactions;assembly=Slex.Lib"      
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="InvokeMethod Page">
    <Grid x:Name="LayoutRoot">
        <i:Interaction.Triggers>
            <slex:EventTrigger ElementName="btnName" EventName="Click">
                <slex:InvokeMethodAction MethodName="Add">
                        <slex:ActionParameters>
                            <slex:ActionParameter ElementName="txt1" Property="Text"/>
                            <slex:ActionParameter ElementName="txt2" Property="Text"/>
                        </slex:ActionParameters>    
                </slex:InvokeMethodAction>
            </slex:EventTrigger>
        </i:Interaction.Triggers>
        <StackPanel>
            <TextBlock FontSize="20" Text="Invoke Method Demo"/>
            <TextBlock Text="Enter A" Margin="3"/>
            <TextBox Name="txt1"/>
            <TextBlock Text="Enter B" Margin="3"/>
            <TextBox Name="txt2"/>
            <Button Content="Find A + B by invoking Add method" Name="btnName"/>            
            <TextBlock Text="{Binding Data}" Margin="3"/>
        </StackPanel>
    </Grid>
</navigation:Page>
